<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/auth', 'AuthController@login');

Route::group(['middleware' => ['auth.user']], function () {
    Route::delete('/auth', 'AuthController@logout');
});
Route::post('/auth/authenticate', 'AuthController@authenticate');

Route::get('/user/profile', 'UserController@getProfile');
Route::put('/user/profile', 'UserController@updateProfile');

Route::get('/job', 'JobController@getJobs');
Route::get('/job/{job_id}', 'UserController@getJob');
Route::post('/job', 'JobController@createJob');
Route::put('/job/{job_id}', 'JobController@updateJob');
Route::delete('/job/{job_id}', 'JobController@deleteJob');

Route::get('/order', 'OrderController@getOrders');
Route::get('/order/{order_id}', 'OrderController@getOrder');
Route::post('/order','OrderController@createOrder');

Route::get('/apply', 'ApplyController@getApplies');
Route::get('/apply/{apply_id}', 'ApplyController@getApply');
Route::post('/apply', 'ApplyController@createApply');
Route::put('/apply/{apply_id}', 'ApplyController@updateApply');

Route::get('/article', 'ArticleController@getArticles');
Route::get('/article/{article_id}', 'ArticleController@getArticle');

Route::get('/article/{article_id}/comment');
Route::post('/article/{article_id}/comment');

Route::post('/transaction', 'TransactionController@create');
Route::get('/transaction', 'TransactionController@getTransactions');
Route::get('/transaction/{transaction_id}', 'TransactionController@getTransaction');

Route::get('/wallet', 'WalletController@getWallet');
Route::get('/wallet/card', 'WalletController@getCards');
Route::get('/wallet/card/{card_id}', 'WalletController@getCard');
Route::post('/wallet/card', 'WalletController@addCard');
Route::delete('/delete/{card_id}', 'WalletController@deleteCard');

